package controllers;

import javax.swing.table.DefaultTableModel;



	public class MyTableModel extends DefaultTableModel{

		Object[][] rawData;
		Object[] columnNames;
		boolean[] editableColumns = new boolean[]{false, false, false, true, true, false, false, false, true};
		int rowToEdit = -2;

		public MyTableModel(Object[][] rawData, Object[] columnNames){
			super(rawData, columnNames);
			this.rawData = rawData;
			this.columnNames = columnNames;
		}
		@Override
		public boolean isCellEditable(int rowIndex, int columnIndex){
			if(rowToEdit == rowIndex){
				return true;
			}
			else return editableColumns [columnIndex];
		}

		public void editRow(int row){
			rowToEdit = row;
		}
	}